package testng.service;

import com.iwhalecloud.citybrain.flow.platform.manager.FlowEngineApplication;
import com.iwhalecloud.citybrain.flow.platform.manager.domain.repository.FlowBusiRepository;
import com.iwhalecloud.citybrain.flow.platform.manager.domain.model.FlowBusiUpdateVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests;

import java.util.ArrayList;
import java.util.List;

/**
 * @author cheng.huaxing
 * @date 2019-03-04
 */
@SpringBootTest(classes = FlowEngineApplication.class)
public class FlowBusiServiceImplTest extends AbstractTransactionalTestNGSpringContextTests {

    @Autowired
    private FlowBusiRepository flowBusiRepository;

    //@Test
    public void testList() {
        List<Integer> list = new ArrayList<>();
        list.add(10);
        flowBusiRepository.list(list);
    }

    //@Test
    public void testUpdate() {
        FlowBusiUpdateVo busiUpdateVo = new FlowBusiUpdateVo();
        busiUpdateVo.setId(0);
        flowBusiRepository.update(busiUpdateVo);
    }

    //@Test
    public void testUpdate2() {
        FlowBusiUpdateVo busiUpdateVo = new FlowBusiUpdateVo();
        busiUpdateVo.setId(35);
        busiUpdateVo.setAppId(0);
        flowBusiRepository.update(busiUpdateVo);
    }
}